﻿using QLInternet.Connection;
using QLInternet.Source;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace QLInternet.Model
{
    class Modem
    {
        private int maModem;
        private string tenModem;
        private int loaiCaiDat;
        private int donGia;
        private QuanLy qL;
        public Connect conn = new Connect("localhost", "internet", "root", "");

        private int sTT;
        public int STT
        {
            get { return sTT; }
            set { sTT = value; }
        }

        public int MaModem
        {
            get { return maModem; }
            set { maModem = value; }
        }
        public string TenModem
        {
            get { return tenModem; }
            set { tenModem = value; }
        }
        public int LoaiCaiDat
        {
            get { return loaiCaiDat; }
            set { loaiCaiDat = value; }
        }
        public int DonGia
        {
            get { return donGia; }
            set { donGia = value; }
        }

        public Modem()
        {
            qL = new QuanLy();
        }
        public ObservableCollection<Modem> getDSModem()
        {
            if (!conn.IsOpenning)
                conn.getConnect();
            return qL.loadDSModem(conn);
            
        }

        
    }
}
